﻿using PersonalWeekReport.Models.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;

namespace PersonalWeekReport.Models.Config
{
    public abstract class Canlendar
    {
        [Key]
        public Guid Id { set; get; }

        [Editable(false)]
        public string OwnerId { set; get; }

        public virtual ICollection<CanlendarNote> CanlendarNotes{set;get;}

    }

    public class CanlendarNote
    {
        public Guid Id { set; get; }

        [Editable(false)]
        public string CanlendarId { set; get; }

        [ForeignKey("CanlendarId")]
        public virtual Canlendar Canlendar{ set; get; }

        [DataType(DataType.Date),Display(Name ="日期")]
        public DateTime Date { set; get; }

        [Display(Name ="安排")]
        public DateNoteType? Type { set; get; }

        [Display(Name ="说明"),StringLength(50)]
        public string Note { set; get; }



    }

    public enum DateNoteType
    {
        正常=0,
        上班=1,
        放假=2
    }

//公司日历
    public class CompanyCanlendar:Canlendar
    {
        [ForeignKey("OwnerId")]
        public virtual Company Company { set; get; }


    }
//部门历
    public class DepartmentCanlendar : Canlendar
    {
        [ForeignKey("OwnerId")]
        public virtual Department Department{ set; get; }


    }

}